//
//  BaseTabBarController.m
//  RoadKnowEntertainment
//
//  Created by lanou on 16/8/5.
//  Copyright © 2016年 RKE. All rights reserved.
//

#import "BaseTabBarController.h"
#import "NewsHomePageViewController.h"
#import "VideoListViewController.h"
#import "MyViewController.h"
#import "MusicTableViewController.h"
@interface BaseTabBarController () <UITabBarControllerDelegate>

@end

@implementation BaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NewsHomePageViewController *newsVC = [NewsHomePageViewController new];
    VideoListViewController *videoVC = [VideoListViewController new];
    MyViewController *myVC = [MyViewController new];
    MusicTableViewController *playVC = [MusicTableViewController new];
    
    
    
    newsVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"新闻" image:[[UIImage imageNamed:@"tabbar_icon_news_normal@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_icon_news_highlight@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    videoVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"视频" image:[[UIImage imageNamed:@"tabbar_icon_media_normal@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_icon_media_highlight@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    playVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"音乐" image:[[UIImage imageNamed:@"音乐 (2)"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"音乐 (3)"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    myVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"我" image:[[UIImage imageNamed:@"tabbar_icon_me_normal@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"tabbar_icon_me_highlight@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    //四个导航栏
    UINavigationController *newsNav = [[UINavigationController alloc] initWithRootViewController:newsVC];
    UINavigationController *videoNav = [[UINavigationController alloc] initWithRootViewController:videoVC];
    UINavigationController *playNav = [[UINavigationController alloc] initWithRootViewController:playVC];
    UINavigationController *myNav = [[UINavigationController alloc] initWithRootViewController:myVC];
    
    newsNav.navigationBar.translucent = YES;
    self.viewControllers = @[newsNav, videoNav, playNav, myNav];
    self.tabBar.tintColor = [UIColor redColor];
    self.selectedIndex = 0;
    
    self.tabBar.translucent = NO;
    self.delegate = self;
    
    
    
    
}

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
    viewController.tabBarItem.badgeValue = nil;
}







@end
